package com.hnxxxy.common.tools;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class TreeObj implements Serializable {

    private Integer id;
    @JsonProperty("parentId")
    private Integer pid = 0;
    private String title;
    private String icon;
    private String href;
    private Boolean spread = false;
    private String checkArr = "0";// 0代表未选中，1代表选中
    private List<TreeObj> children;

    /**
     * dree的数据格式
     * @param id
     * @param pid
     * @param title
     */
    public TreeObj(Integer id, Integer pid, String title) {
        this.id = id;
        this.pid = pid;
        this.title = title;
    }

    /**
     * dree的复选树的数据格式
     * @param id
     * @param pid
     * @param title
     * @param checkArr
     */
    public TreeObj(Integer id, Integer pid, String title, String checkArr) {
        this.id = id;
        this.pid = pid;
        this.title = title;
        this.checkArr = checkArr;
    }
}